package com.bjpowernode.threadpool.executors;

import java.util.concurrent.Callable;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

public class Test01 {

    public static void main(String[] args) throws Exception {
        Callable<Object> callable = Executors.callable(() -> {
            System.out.println(1);
        });
        callable.call();

        //ExecutorService executorService = Executors.newFixedThreadPool(10);
        //ExecutorService executorService = Executors.newSingleThreadExecutor();
        ExecutorService executorService = Executors.newCachedThreadPool();

        while (true) {
            executorService.submit(() -> {
                //ThreadUtils.sleep(1);
            });
        }
    }
}